package com.hejielife.producerconsumer5;

/**
 * 2019年8月2日 下午2:31:30
 * 
 * @author hejielife
 * @despribe LazyThread 闲的没事干的人
 */

public class LazyThread extends Thread {
	private final Table table;

	public LazyThread(String name, Table table) {
		super(name);
		this.table = table;
	}

	public void run() {
		while (true) {
			try {
				synchronized (table) {
					table.wait();
				}
				System.out.println(getName() + " is notified!");
			} catch (InterruptedException e) {
			}
		}
	}
}
